//
//  WHYEmoticons.swift
//  emoticonKeyboard
//
//  Created by 王洪运 on 15/11/29.
//  Copyright © 2015年 王洪运. All rights reserved.
//

import UIKit

class WHYEmoticon: NSObject {

    /// 表情使用次数
    var times = 0
    /// 是否是空白按钮
    var isEmpty = false
    /// 是否是删除按钮
    var isRemove = false
    /// 删除按钮图片的完整地址
    var removeImagePath: String {
        return NSBundle.mainBundle().bundlePath + "/Emoticons.bundle/Delete/compose_emotion_delete.png"
    }
    /// 表情文字
    var chs: String?
    /// 表情图片文件名
    var png:String?
    /// emoji编码
    var code:String? {
        didSet {
            emoji = code?.emoji
        }
    }
    /// emoji字符串
    var emoji: String?
    /// 图片完整的路径
    var imagePath: String {
        return png == nil ? "" : NSBundle.mainBundle().bundlePath + "/Emoticons.bundle/" + png!
    }

//    MARK: - 构造函数
    init(isEmpty: Bool) {
        self.isEmpty = isEmpty
        super.init()
    }
    
    init(isRemove: Bool) {
        self.isRemove = isRemove
        super.init()
    }
    
    init(dict: [String: AnyObject]) {
        super.init()
        
        setValuesForKeysWithDictionary(dict)
    }
    
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {    }
    
    override var description: String {
        let keys = ["chs", "png","code"]
        
        return dictionaryWithValuesForKeys(keys).description
    }
    
}
